package com.sc.highspeed.service;

import com.sc.highspeed.db.dao.OrganizationDao;
import com.sc.highspeed.db.model.OrganizationModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.metadata.OracleCallMetaDataProvider;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Admin on 2017/11/27.
 */
@Service
public class OrganizationService {

    @Autowired
    private OrganizationDao organizationDao;

    public OrganizationModel getOrganizationByName(String name) {
        return organizationDao.getOrganizationByName(name);
    }

    public List<OrganizationModel> getOrganizationList() {
        return organizationDao.getOrganizationList();
    }

    public int updateOrganizationById(OrganizationModel organizationModel) {
        return organizationDao.updateOrganizationById(organizationModel);
    }

    public int updateOrganizationRemarkByName(String name, String remark) {
        return organizationDao.updateOrganizationRemarkByName(name, remark);
    }

    public int updateOrganizationIntroByName(String name, String intro) {
        return organizationDao.updateOrganizationIntroByName(name, intro);
    }


    public int insertOrganization(OrganizationModel organizationModel) {
        return organizationDao.insertOrganization(organizationModel);
    }

    public int deleteOrganizationByName(String name) {
        return organizationDao.deleteOrganizationByName(name);
    }

    public int updateOrganizationIsCheckByName(String name, String isCheck) {
        return organizationDao.updateOrganizationIsCheckByName(name, isCheck);
    }

    public int updateOrganizationParent(int id, String parentName) {
        return organizationDao.updateOrganizationParent(id, parentName);
    }

    public OrganizationModel getOrganizationById(int id) {
        return organizationDao.getOrganizationById(id);
    }

    public List<OrganizationModel> getOrganizationByParent(String parentName) {
        return organizationDao.getOrganizationByParent(parentName);
    }


}
